﻿// 编辑
App.KnowledgeDetailEditView = Ember.View.extend({
    template: Ember.$.loadView('KnowledgeDetail.Edit'),

    didInsertElement: function () {
        var $dom = $('#menuBar');
        $dom.affix({
            offset: {
                top: function () {
                    return $dom.data('offset-top');
                }
            }
        });

        CKEDITOR.replace('iptCases', {
            toolbar: 'Basic',
            uiColor: '#FAFAFA'
        });
    }
});

// 查看
App.KnowledgeDetailDetailView = Ember.View.extend({
    template: Ember.$.loadView('KnowledgeDetail.Detail'),

    didInsertElement: function () {
        var $dom = $('#menuBar');
        $dom.affix({
            offset: {
                top: function () {
                    return $dom.data('offset-top');
                }
            }
        });

        PR.prettyPrint();
    }
});

// 列表
App.KnowledgeDetailListView = Ember.View.extend({
    template: Ember.$.loadView('KnowledgeDetail.Index'),

    didInsertElement: function () {
        if (userJson.UserName == 'ligd' ||
            userJson.UserName == 'chenhy03' ||
            userJson.UserName == 'jinjw' ||
            userJson.UserName == 'liuy03') {
            $('.hover-show').find('.hidden')
                .removeClass('hidden');
        };
    }
});